 <html>

<body>

<form name="form1" action="fileUpload.php" method="post" enctype="multipart/form-data">
<label for="file">File:</label>
<input type="file" name="file" id="file" />
<br />
<input type="hidden" name="multi" value="false"/>
<input type="submit" name="submit" value="Submit Single" />
</form>


<form action="fileUpload.php" method="post" enctype="multipart/form-data">
<label for="file2">File[]:</label>
<input type="file" name="file[]" id="file2" />
<br />
<label for="file3">File[]:</label>
<input type="file" name="file[]" id="file3" />
<br />
<input type="hidden" name="multi" value="true"/>
<input type="submit" name="submit" value="Submit Array" />
</form>

<script>
function setAction(){
    document.form2.action = "fileUpload.php";
}
</script>

<form name="form2" action="" method="post" enctype="multipart/form-data" onsubmit="setAction()">
<label for="file">File:</label>
<input type="file" name="file" id="file4" />
<br />
<input type="hidden" name="multi" value="false"/>
<input type="submit" name="submit" value="Submit Single" />
</form>

</body>
</html>